#include<iostream>
using namespace std;

int main()
{
	int s1, s2, s3;
	int count = 0;
	cin >> s1 >> s2 >> s3;
	
	if (s1 < 60)
		count++;
	if (s2 < 60)
		count++;
	if (s3 < 60)
		count++;
	
	if (count == 1)
		cout << 1 << endl;
	else
		cout << 0 << endl;
	
	return 0;
}
